package com.example.demo.mapper;

import com.example.demo.model.MessageInfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface MessageInfoMapper {
    //插入数据
    @Insert("insert into message_info(`from`, `to` ,`message`) " +
            "values(#{from}, #{to}, #{message})")
    Integer insertMessageInfo(MessageInfo messageInfo);

    //导出数据
    @Select("select * from message_info")
    List<MessageInfo> getMessageInfoList();
}


